<template>
  <div class="container">
    <h3>新增管理员</h3>
    登录的账户名:
    <el-input size="small " type="text" v-model="newAdmin.account" /> <br />
    登录密码:
    <el-input size="small " type="text" v-model="newAdmin.password" /> <br />
    真实名字:
    <el-input size="small " type="text" v-model="newAdmin.realname" /> <br />
    手机号码:
    <el-input size="small " type="text" v-model="newAdmin.telephone" /> <br />
    <el-button type="primary" @click="add">确认新增</el-button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      newAdmin: {},
    };
  },
  methods: {
    add() {
      this.$api.userApi.addAdmins(this.newAdmin).then(({ data }) => {
        this.$message.success(data.msg);
        // console.log(data);
        this.$emit('getAllAdmins')
      });
    },
  },
};
</script>

<style scoped>
.img {
  margin-bottom: 10px;
}
.container {
  background-color: #fff;

  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  padding: 30px;
}
</style>
